package com.jcl.myutils.listener;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

@Component
public class Component2  {
    private static final Logger log = LoggerFactory.getLogger(Component2.class);

    // @Override
    // public void onApplicationEvent(UserRegisterEvent event) {
    //     System.out.println("事件触发：" + event.toString());
    // }

    @EventListener(classes = UserRegisterEvent.class)
    public void aaa(UserRegisterEvent event) {
        // log.debug("事件触发：{}", event);
        System.out.println("" + event);
    }
}
